Skip to main content

Address Match API

This document outlines the details of the Address Match API.

API Description

Objective

The Address Match API compares two input addresses and returns an overall similarity score. It also provides segment-level comparison scores for individual address components such as house, street, locality, city, state, and pincode, enabling a detailed evaluation of address similarity.

InputOutput
The two addresses for comparisonOverall similarity score along with individual scores for each address component

API URL

https://ind-engine.thomas.hyperverge.co/v1/address_match

API Endpoint

address_match

Overview

The API is RESTful and uses standard HTTP verbs and status codes. The responses are in JSON format and you should upload all images and files as form-data through a POST request.

Authentication

You need a unique pair of application ID ( appId ) and application key (appKey) from HyperVerge to verify your identity for accessing the API.

API Request Details

Method - POST

Headers

ParameterMandatory or OptionalTypeDescriptionValid Values
content-type Mandatory string This parameter defines the media type for the request payload.multipart/form-data
appIdMandatorystringThe application ID shared by HyperVergeNot Applicable - this is a unique value.
appKeyMandatorystringThe application key shared by HyperVergeNot Applicable - this is a unique value.
transactionIdMandatorystringThe unique ID for the customer journey.Not Applicable - this is a unique value related to a transaction in your application.

Input

The following table provides the details of the parameter required for the API's request body:

ParameterMandatory or OptionalDescriptionAllowed ValuesDefault Value
address1MandatoryThe first address. This value will be compared with the address2 parameterA valid address stringNot Applicable
address2MandatoryThe second address. This value will be compared with the address1 parameterA valid address stringNot Applicable
returnMatchingSegmentsOptionalIndicates if the response should return the matching address segmentsyes, noNot Applicable
regionOptionalThe region for comparison logic, e.g., "ind" for IndiaNot ApplicableNot Applicable
returnSegmentScoresOptionalIndicates if the response should return segment-level scoresyes, noNot Applicable

Request

The following code snippet demonstrates a standard curl request for the API:

curl --location --request POST 'https://ind-engine.thomas.hyperverge.co/v1/address_match' \
--header 'Content-Type: multipart/form-data' \
--header 'appId: <Enter_the_HyperVerge_appId>' \
--header 'appKey: <Enter_the_HyperVerge_appKey>' \
--header 'transactionId: <Enter_the_HyperVerge_transactionID>' \
--form 'address1="<Enter_the_first_address>"' \
--form 'address2="<Enter_the_second_address>"' \
--form 'returnMatchingSegments="<Enter_yes_or_no>"' \
--form 'region="<Enter_the_region>"' \
--form 'returnSegmentScores="<Enter_yes_or_no>"'

Success Responses

The following code snippet demonstrates the success responses from the API, when the parameters returnSegmentScores and returnMatchingSegments are enabled in the request:

{
"status": "success",
"statusCode": 200,
"result": {
"overall_score": 0.5,
"segments": {
"house": {
"match": "no",
"score": 0
},
"street_name_or_landmark_nearby": {
"match": "no",
"score": 0.55
},
"locality": {
"match": "no",
"score": 0.35
},
"city": {
"match": "yes",
"score": 1
},
"state": {
"match": "yes",
"score": 1
},
"pincode": {
"match": "no",
"score": 0
}
}
}
}


The following success responses are returned when the parameters returnSegmentScores and returnMatchingSegments are not enabled in the request:

When the returnSegmentScores parameter is not included, only the match results (without scores) for each segment are returned:

{
"status": "success",
"statusCode": 200,
"result": {
"overall_score": 0.51,
"segments": {
"house": {
"match": "no"
},
"street_name_or_landmark_nearby": {
"match": "no"
},
"locality": {
"match": "no"
},
"city": {
"match": "yes"
},
"state": {
"match": "yes"
},
"pincode": {
"match": "no"
}
}
}
}

Success Response Details

The following table outlines the details of the success response from the API:

ParameterTypeDescription
statusstringThe status of the request
statusCodeintegerThe HTTP status code for the request
resultobjectThe result object containing the address match details
overall_scorefloatThe overall score representing the similarity between the two addresses, ranging from 0 to 1
segmentsobjectAn object containing segment-level match results
houseobjectThe matching result and score (if applicable) for the house number or building
house.matchstringIndicates if the house information matches between the two addresses
house.scorefloatThe similarity score for the house segment, ranging from 0 to 1
street_name_or_landmark_nearbyobjectThe matching result and score (if applicable) for the street name or nearby landmark
street_name_or_landmark_nearby.matchstringIndicates if the street or landmark matches between the two addresses
street_name_or_landmark_nearby.scorefloatThe similarity score for the street or landmark segment (if returned)
localityobjectThe matching result and score (if applicable) for the locality or area
locality.matchstringIndicates if the locality matches between the two addresses
locality.scorefloatThe similarity score for the locality segment (if returned)
cityobjectThe matching result and score (if applicable) for the city
city.matchstringIndicates if the city matches between the two addresses
city.scorefloatThe similarity score for the city segment (if returned)
stateobjectThe matching result and score (if applicable) for the state
state.matchstringIndicates if the state matches between the two addresses
state.scorefloatThe similarity score for the state segment (if returned)
pincodeobjectThe matching result and score (if applicable) for the pincode
pincode.matchstringIndicates if the pincode matches between the two addresses
pincode.scorefloatThe similarity score for the pincode segment (if returned)

Error Responses

The following are some error responses from the API:

{
"message": "Input Validation Error: requires property \"address1\"",
"statusCode": 400,
"status": "failure"
}

Error Response Details

A failure or error response from the module contains a failure status, with a relevant status code and error message.

The following table lists all error responses:

Status CodeError MessageError Description
400Input Validation Error: requires property address1 The address input fields in the request are either missing or invalid
401Missing/Invalid credentialsThe request is either missing the mandatory appId and appKey combination or has invalid values
500Internal Server ErrorPlease check the request headers or contact the HyperVerge team for resolution
Was this helpful?
Ask AIBeta
Hi! How can I help?
Ask me anything about HyperVerge products, APIs, and SDKs.
Try asking: